package com.baidu.Chapter02;

import java.util.Scanner;

public class ex2_23 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter the driving distance:");
        double distance = sc.nextDouble();
        System.out.print("Enter miles per gallon:");
        double gallon = sc.nextDouble();
        System.out.print("Enter price per gallon:");
        double price = sc.nextDouble();
        double sum = distance / gallon * price;
        System.out.println("The cost of driving is $:" + String.format("%.2f", sum));
    }
}
